package day2;

import java.util.Scanner;

import org.junit.Test;
//课本第二章课后题
public class work2 {
	@Test
	public void test1() {
		Scanner scanner = new Scanner(System.in);
		int[][] array = new int[2][3];
		for (int i = 0; i < array.length; i++) {
			
			for (int j = 0; j < array[i].length; j++) {
				System.out.println("输入第"+(i+1)+"行第"+(j+1)+"个数");
				array[i][j] = scanner.nextInt();
			}
			
		}
		
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]+"\t");
			}
			System.out.println();
		}
	}
	
	@Test
	public void test2() {
		
		Scanner scanner = new Scanner(System.in);
		System.out.println("输入人数：");
		int x = scanner.nextInt(); 
		String[][] array = new String[x][3];
		
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.println("输入第"+(i+1)+"行第"+(j+1)+"个信息");
				array[i][j] = scanner.next();
				//System.out.println("adadad");
			}
		}
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]+"\t");
			}
			System.out.println();
		}
		
		
	}
	
	@Test
	public void test3() {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入数组的长度：");
		int x = scanner.nextInt();
		int[] array = new int[x];
		for (int i = 0; i < array.length; i++) {
			System.out.println("请输入第"+(i+1)+"个数：");
			array[i] = scanner.nextInt();
		}
		
		for (int i = 0; i < array.length; i++) {
			int temp;
			temp = array[i];
			array[i] = array[array.length-1-i];
			array[array.length-1-i] = temp;
			if (i == array.length/2) {
				break;
			}
		}
		System.out.println("倒序输出结果为：");
		for (int i = 0; i < array.length; i++) {
			
			System.out.print(array[i]);
		}
	}
	
	@Test
	public void test4() {
		int[] scrore = {0,0,1,2,3,5,4,5,2,8,7,6,8,1,2,0,8,3,7,8,1,0,4,7,1,8,4,7,1,0,4,7,0};
		for (int i = 0; i < scrore.length; i++) {
			
				
			
		}
	}
	
	
}
